package cn.edu.sjtu.stap.hg.builder;

import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;

import cn.edu.sjtu.stap.hg.*;

public class DefaultHgBuilder implements IHgBuilder {
    private static DefaultHgBuilder instance = null;

    public DefaultHgBuilder() {
        // Empty.
    }

    public static DefaultHgBuilder getInstance() {
        if (instance == null) {
            instance = new DefaultHgBuilder();
        }
        return instance;
    }

    private HierarchyGraph hg = null;

    public void initialize() {
        hg = new HierarchyGraph();
    }

    public void buildHierarchyGraph(CompilationUnitDeclaration unit) {
        hg.addType(unit);
    }

    public HierarchyGraph getResult() {
        return hg;
    }
}
